// Please use the following namespace
// using System.Windows.Forms;
// using GrapeCity.Win.Editors;
public void SetGcCommonValidatorSettings()
{
// Creates an instance of a GcTextBox control.
GcTextBox gcTextBox1 = new GcTextBox();
// Creates an instance of a GcCommonValidator component.
GcCommonValidator gcCommonValidator1 = new GcCommonValidator();
// Creates a FocusProcess object.
FocusProcess focusProcess1 = new FocusProcess();
focusProcess1.PreventFocusLeave = true;
// Creates an InvalidPairChar object.
InvalidPairChar invalidPairChar1 = new InvalidPairChar();
PairChar pairChar1 = new PairChar();
PairChar pairChar2 = new PairChar();
PairChar pairChar3 = new PairChar();
PairChar pairChar4 = new PairChar();
pairChar1.Left = '[';
pairChar1.Right = ']';
pairChar2.Left = '{';
pairChar2.Right = '}';
pairChar3.Left = '(';
pairChar3.Right = ')';
pairChar4.Left = '「';
pairChar4.Right = '」';
invalidPairChar1.PairChars.AddRange(new PairChar[] {pairChar1,pairChar2,pairChar3,pairChar4});
// Gets the ValidateActions defined for the gcTextBox, and adds the FocusProcess object to the collection.
gcCommonValidator1.GetValidateActions(gcTextBox1).AddRange(new ValidateAction[] { focusProcess1 });
// Gets the ValidateItems defined for the gcTextBox, and adds the InvalidPairChar object to the collection.
gcCommonValidator1.GetValidateItems(gcTextBox1).AddRange(new object[] {invalidPairChar1});
}
' Please use the following namespace
' Imports System.Windows.Forms;
' Imports GrapeCity.Win.Editors;
Public Sub SetGcCommonValidatorSettings()
' Creates an instance of a GcTextBox control.
Dim gcTextBox1 As New GcTextBox()
' Creates an instance of a GcCommonValidator component.
Dim gcCommonValidator1 As New GcCommonValidator()
' Creates a FocusProcess object.
Dim focusProcess1 As New FocusProcess()
focusProcess1.PreventFocusLeave = True
' Creates an InvalidPairChar object.
Dim invalidPairChar1 As New InvalidPairChar()
Dim pairChar1 As New PairChar()
Dim pairChar2 As New PairChar()
Dim pairChar3 As New PairChar()
Dim pairChar4 As New PairChar()
pairChar1.Left = "["c
pairChar1.Right = "]"c
pairChar2.Left = "{"c
pairChar2.Right = "}"c
pairChar3.Left = "("c
pairChar3.Right = ")"c
pairChar4.Left = "「"c
pairChar4.Right = "」"c
invalidPairChar1.PairChars.AddRange(New PairChar() {pairChar1, pairChar2, pairChar3, pairChar4})
' Gets the ValidateActions defined for the gcTextBox, and adds the FocusProcess object to the collection.
gcCommonValidator1.GetValidateActions(gcTextBox1).AddRange(New ValidateAction() {focusProcess1})
' Gets the ValidateItems defined for the gcTextBox, and adds the InvalidPairChar object to the collection.
gcCommonValidator1.GetValidateItems(gcTextBox1).AddRange(New Object() {invalidPairChar1})
End Sub